<?PHP

global $conf;
?>




<div class='c-box-600 c-box c-box-left' id='media-info'>
<h1><?PHP echo $media['name']; ?></h1>
<h2><?PHP echo $media['artist']; ?></h2>
<h4><?PHP echo $media['album']; ?></h4>
<p>This song has been played <?PHP echo $media['play']; ?> times</p>
</div>

<div class='c-box-600 c-box c-box-left' id='media-album'>
	<h3>More from <?PHP echo $media['artist']; ?></h3>
	
	<?PHP

	foreach($album_music as $x)
	{
	?>

		<li>
			<a href='media/<?PHP echo $x["id"];?>'><?PHP echo $x['name'];?></a>
			
			<p><?PHP echo $x['album'];?></p>
		</li>
		<?PHP
	}
	?>

</div>

<div class='c-box-headline c-box-300 c-box c-box-latest-videos c-box-right' id='media-latest'>
	<h3>Hear this song from</h3>
	<?PHP
	$items=0;
	
	foreach($ci as $x)
	{
		
		if($items <= 2 && !empty($x['title']))
		{
			
		
			?>
			
				<li>
						<div class='c-box-latest-item-image' style="background-image:url('<?PHP echo ap($x['thumb']);?>');">
							<a href='popout/<?PHP echo $x["id"];?>/<?PHP echo csq($x["title"]);?>' class="popoutplayer">
								<img src="assets/images/play-mini.png" width="60" height="24" alt="Play Mini">
							</a>
						</div>
						
					<a href='popout/<?PHP echo $x["id"];?>/<?PHP echo csq($x["title"]);?>' class="popoutplayer c-box-latest-link"><?PHP  echo $x['title']."<br />";?></a>
					<?PHP  echo $x['secondary'];?>
					
				
			
				</li>
			<?PHP
			$items++;
		}
		

	}
	
	if($items==0)
	{
		?>
		
		<p>Do you want to listen to this song? <?PHP echo $media['request']; ?> people have requested this song</p>
		<div id='request-box'>
		<a id='request-this-song'>Request this song</a>	
		</div>
		
		
		<script type="text/javascript" charset="utf-8">
			$('#request-this-song').click(function () {
	
		     	var songid=<?PHP echo $media['id']; ?>;
				$.ajax({ type: 'POST', url: "a/request-song.php", data: "id="+songid, context: document.body, success: function(data){
			    	$("#request-box").fadeOut(150);
			
					$("#request-box").html(data);

					$("#request-box").fadeIn(150);

			      }});
		    });
		</script>
		<?PHP
	
	}
	
	?>
	
</div>
<div class='c-box-headline c-box-300 ad-med-300-250 c-box-right' id='media-medrect'>
	
		<?PHP
		if($conf->advertise)
		{
			include 'assets/ads/adsense-medrect.php';
		}
		?>
	</div>

